@import "../../themes/ionic.globals.md";

// Material Design Card
// --------------------------------------------------

/// @prop - Margin top of the card
$card-md-margin-top:                  10px !default;

/// @prop - Margin right of the card
$card-md-margin-right:                10px !default;

/// @prop - Margin bottom of the card
$card-md-margin-bottom:               10px !default;

/// @prop - Margin left of the card
$card-md-margin-left:                 10px !default;


/// @prop - Padding top of the card
$card-md-padding-top:                 13px !default;

/// @prop - Padding right of the card
$card-md-padding-right:               16px !default;

/// @prop - Padding bottom of the card
$card-md-padding-bottom:              13px !default;

/// @prop - Padding left of the card
$card-md-padding-left:                16px !default;

/// @prop - Padding top of the media on the card
$card-md-padding-media-top:           10px !default;

/// @prop - Padding bottom of the media on the card
$card-md-padding-media-bottom:        10px !default;

/// @prop - Size of the card avatar
$card-md-avatar-size:                 4rem !default;

/// @prop - Size of the card thumbnail
$card-md-thumbnail-size:              8rem !default;

/// @prop - Background color of the card
$card-md-background-color:            $list-md-background-color !default;

/// @prop - Box shadow of the card
$card-md-box-shadow:                  0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12) !default;

/// @prop - Border radius of the card
$card-md-border-radius:               2px !default;


/// @prop - Font size of the card
$card-md-font-size:                   1.4rem !default;

/// @prop - Line height of the card
$card-md-line-height:                 1.5 !default;

/// @prop - Color of the card text
$card-md-text-color:                  #222 !default;

/// @prop - Font size of the card title
$card-md-title-font-size:             2.4rem !default;

/// @prop - Padding of the card title
$card-md-title-padding:               8px 0 8px 0 !default;

/// @prop - Margin of the card title
$card-md-title-margin:                2px 0 2px !default;

/// @prop - Color of the card title
$card-md-title-text-color:            #222 !default;

/// @prop - Font size of the card header
$card-md-header-font-size:            1.6rem !default;

/// @prop - Padding of the card header
$card-md-header-padding:              16px !default;

/// @prop - Color of the card header
$card-md-header-color:                #222 !default;


.card-md {
  margin: $card-md-margin-top $card-md-margin-right $card-md-margin-bottom $card-md-margin-left;

  width: calc(100% - #{($card-md-margin-right + $card-md-margin-left)});

  border-radius: $card-md-border-radius;
  font-size: $card-md-font-size;

  background: $card-md-background-color;
  box-shadow: $card-md-box-shadow;
}

.card-md ion-list {
  margin-bottom: 0;
}

.card-md > .item:last-child,
.card-md > .item:last-child .item-inner,
.card-md > .item-wrapper:last-child .item {
  border-bottom: 0;
}

.card-md .item-md.item-block .item-inner {
  border: 0;
}

.card-content-md {
  padding: $card-md-padding-top $card-md-padding-right $card-md-padding-bottom $card-md-padding-left;

  font-size: $card-md-font-size;
  line-height: $card-md-line-height;
}

.card-header-md {
  padding: $card-md-header-padding;

  font-size: $card-md-header-font-size;
  color: $card-md-header-color;
}

.card-header-md + .card-content-md,
.card-md .item + .card-content-md {
  padding-top: 0;
}

.card .note-md {
  font-size: 1.3rem;
}

.card-title-md {
  display: block;

  margin: $card-md-title-margin;
  padding: $card-md-title-padding;

  font-size: $card-md-title-font-size;
  line-height: 1.2;
  color: $card-md-title-text-color;
}

.card-md h1 {
  margin: 0 0 2px;

  font-size: 2.4rem;
  font-weight: normal;
  color: $card-md-text-color;
}

.card-md h2 {
  margin: 2px 0;

  font-size: 1.6rem;
  font-weight: normal;
  color: $card-md-text-color;
}

.card-md h3,
.card-md h4,
.card-md h5,
.card-md h6 {
  margin: 2px 0;

  font-size: 1.4rem;
  font-weight: normal;
  color: $card-md-text-color;
}

.card-md p {
  margin: 0 0 2px;

  font-size: 1.4rem;
  font-weight: normal;
  line-height: 1.5;
  color: $card-md-text-color;
}

.card-md + ion-card {
  margin-top: 0;
}


// Generate Material Design Card Colors
// --------------------------------------------------

@each $color-name, $color-base, $color-contrast in get-colors($colors-md) {

  .card-md .text-md-#{$color-name} {
    color: $color-base;
  }

  .card-md-#{$color-name} {
    color: $color-contrast;
    background-color: $color-base;

    .card-header-md,
    .card-title-md,
    .card-content-md,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p {
      color: $color-contrast;
    }

    @each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
      .text-md-#{$color-name},
      .card-header-md-#{$color-name},
      .card-title-md-#{$color-name},
      .card-content-md-#{$color-name} {
        color: $color-base;
      }
    }
  }

  .card-header-md-#{$color-name},
  .card-title-md-#{$color-name},
  .card-content-md-#{$color-name} {
    color: $color-base;
  }

}
